package com.crp.unitalinforbaseplat.app.sys.dao;

import com.crp.unitalinforbaseplat.app.sys.entity.RolePermission;
import com.crp.unitalinforbaseplat.app.sys.entity.UserRole;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface RolePermissionMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(RolePermission record);

    int insertSelective(RolePermission record);

    RolePermission selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(RolePermission record);

    int updateByPrimaryKey(RolePermission record);

    /**
     *@Description 根据用户角色查询用户角色对应的权限表
     *@Params [userRoleList]
     *@return java.util.List<com.anhuishangjue.squarenavigationsys.entity.RolePermission>
     *@Author chenzhicai
     *@Date 2018/11/4
     *@Time 3:01 PM
     **/
    List<RolePermission> selectByRoleList(List<UserRole> userRoleList);

    void deleteByRoleId(Long id);

    void insertBatch(List<RolePermission> rolePermissions);
}